﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class car_insurance_new_proposalforms_CarInsuranceProposalMasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string _strCXLive = CE.Configuration.MyConfigurationManager.GetAppSettingValue("TH.IsCXLive");
        if (_strCXLive == "0")
        {
            if (Session[CE.Global.General.Guest] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else if (Session[CE.Global.General.Guest].ToString() == "Provider")
            {
                if (Session[CE.Global.General.UserId] == null)
                {
                    Response.Redirect("~/Provider/ProviderSecureLogin.aspx");
                }
            }
        }

        if (Session[CE.Global.General.UserId] != null)
        {
            CE.Global.General.CreateUpdateUserLoginCached(Page);
        }

        if (Session[CE.Global.General.UserId] != null || Session[CE.Global.General.CarId] != null)
        {
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "JS_AjaxSessionTimer", "../../includes/AjaxSessionTimer.js");
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "JS_Net", "../../includes/net.js");
        }

        if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
        {
            Request.Browser.Adapters.Clear();
        }
    }
}
